//==============================================================================
#include "Component.h"

using namespace std;
using namespace ui;

//==============================================================================
Component::Component(int posX, int posY, int width, int height, COMPONENT_TYPE type, string name)
{
	setXCoordinate(posX);
	setYCoordinate(posY);
	setWidth(width);
	setHeight(height);
	setName(name);
	setType(type);
}
//------------------------------------------------------------------------------
Component::~Component(void)
{
}
//------------------------------------------------------------------------------
void Component::setXCoordinate(int x)
{
	this->x_coordinate = x;
}
//------------------------------------------------------------------------------
int Component::getXCoordinate(void)
{
	return this->x_coordinate;
}
//------------------------------------------------------------------------------
void Component::setYCoordinate(int y)
{
	this->y_coordinate = y;
}
//------------------------------------------------------------------------------
int Component::getYCoordinate(void)
{
	return this->y_coordinate;
}
//------------------------------------------------------------------------------
void Component::setName(string name)
{
	this->name = name;
}
//------------------------------------------------------------------------------
string Component::getName(void)
{
	return this->name;
}
//------------------------------------------------------------------------------
void Component::setWidth(int width)
{
	this->width = width;
}
//------------------------------------------------------------------------------
int Component::getWidth(void)
{
	return this->width;
}
//------------------------------------------------------------------------------
void Component::setHeight(int height)
{
	this->height = height;
}
//------------------------------------------------------------------------------
int Component::getHeight(void)
{
	return this->height;
}
//------------------------------------------------------------------------------
void Component::setType(COMPONENT_TYPE type)
{
	this->type = type;
}
//------------------------------------------------------------------------------
COMPONENT_TYPE Component::getType(void)
{
	return this->type;
}
//------------------------------------------------------------------------------
bool Component::ocurredInside(int posX, int posY)
{
	if( ( posX >= getXCoordinate() ) && ( posX <= (getXCoordinate() + getWidth()) )
		&&  ( posY >= getYCoordinate() ) && ( posY <= (getYCoordinate() + getHeight()) ) )
        return true;
	else
		return false;
}
//==============================================================================
